package meijuli.com.join51.business.utils;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import com.jhx.common.utils.ToastUtil;

import java.net.URLEncoder;

/**
 * Created by wenqin on 2017/3/24.
 */

public class GoInternalAppUtil {

    public static void toBrowser(Context context, String url) {
        try {
            Intent intent = new Intent();
            intent.setAction("android.intent.action.VIEW");
            Uri uri = Uri.parse("alipays://platformapi/startapp?saId=10000007&qrcode=" + URLEncoder.encode(url, "UTF-8"));
            intent.setData(uri);
            context.startActivity(intent);
        } catch (Exception e) {
            ToastUtil.getInstance().showToast(context, "唤起支付宝失败,请安装或升级支付宝");
        }

    }
}
